package lp.xian.materials.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import lp.xian.materials.mapper.StockMapper;
import lp.xian.materials.domain.Stock;
import lp.xian.materials.service.IStockService;

/**
 * 库存商品Service业务层处理
 *
 * @author ruoyi
 * @date 2023-08-18
 */
@Service
public class StockServiceImpl implements IStockService
{
    @Autowired
    private StockMapper stockMapper;

    /**
     * 查询库存商品
     *
     * @param warehouseStockTbId 库存商品主键
     * @return 库存商品
     */
    @Override
    public Stock selectStockByWarehouseStockTbId(Integer warehouseStockTbId)
    {
        return stockMapper.selectStockByWarehouseStockTbId(warehouseStockTbId);
    }

    /**
     * 查询库存商品列表
     *
     * @param stock 库存商品
     * @return 库存商品
     */
    @Override
    public List<Stock> selectStockList(Stock stock)
    {
        return stockMapper.selectStockList(stock);
    }

    /**
     * 新增库存商品
     *
     * @param stock 库存商品
     * @return 结果
     */
    @Override
    public int insertStock(Stock stock)
    {
        return stockMapper.insertStock(stock);
    }

    /**
     * 修改库存商品
     *
     * @param stock 库存商品
     * @return 结果
     */
    @Override
    public int updateStock(Stock stock)
    {
        return stockMapper.updateStock(stock);
    }

    /**
     * 批量删除库存商品
     *
     * @param warehouseStockTbIds 需要删除的库存商品主键
     * @return 结果
     */
    @Override
    public int deleteStockByWarehouseStockTbIds(Integer[] warehouseStockTbIds)
    {
        return stockMapper.deleteStockByWarehouseStockTbIds(warehouseStockTbIds);
    }

    /**
     * 删除库存商品信息
     *
     * @param warehouseStockTbId 库存商品主键
     * @return 结果
     */
    @Override
    public int deleteStockByWarehouseStockTbId(Integer warehouseStockTbId)
    {
        return stockMapper.deleteStockByWarehouseStockTbId(warehouseStockTbId);
    }
}
